var assert = require('assert');
var should = require('should');
var _ = require('lodash');
var arenaModel = require('../../app/models/arenaModel');
var config = require('../config');

suite('arenaModel', function () {
    var arena_model;
    setup(function (done) {
        arenaModel.getByRoleId(config.role_id, function (err, model) {
            assert.equal(err == null, true);
            arena_model = model;
            done();
        });
    });

    suite('竞技场测试', function () {
        test('查询排行榜', function (done) {
            arenaModel.findTop(10, function (err, list) {
                // _.forEach(list, function(item) {
                //     console.log('---%j,%j', item.rank,item.role_id);
                // });
                done();
            });
        });
    });

    suite('刷新竞技商店', function () {
        test('刷新竞技商店', function (done) {
            arena_model.refreshShop();
            arena_model.save(done);
            console.log('shop_list:', arena_model.arena_shop);
        });
    });
});
